//通过vue-router插件实现模板路由配置
import {createRouter,createWebHashHistory} from "vue-router";
import {constantRoute, anyRoute} from '@/router/routes.ts'

//创建路由器(路由配置)
const router = createRouter({
    history: createWebHashHistory(),
    routes: [...constantRoute, ...anyRoute],
    // 滚动行为(确保用户在切换路由后总是从页面顶部开始浏览)
    scrollBehavior() {
        return {
            left: 0,
            top: 0
        }
    }
})

export default router;
